from aligo import Aligo
from download import Download


class Upload:
    def __init__(self):
        with open('refresh_token', 'r') as refresh_token:
            self.ali_obj = Aligo(refresh_token=refresh_token.read())
        self.sync_id = Download().sync_id

    # 先移除云端SYNC
    def _remove(self):
        self.ali_obj.move_file_to_trash(self.sync_id)

    def run(self):
        self.ali_obj.upload_folder('D:\\SYNC', check_name_mode='refuse')
